﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Rappelz.GameServer
{
    public enum CompeteEndType : int
    {
        ByDeath = 0,
        Logout = 1,
        RingOut = 2,
        TimeOut = 3,
        Interrupt = 4,
        EnteringSafetyZone = 5,
    }

    public class CompeteManager
    {
        /// <summary>
        /// The instance!
        /// </summary>
        protected static CompeteManager m_instance;

        /// <summary>
        /// Returns the instance
        /// </summary>
        public static CompeteManager Instance
        {
            get
            {
                if (m_instance == null)
                    m_instance = new CompeteManager();
                return m_instance;
            }
        }

// UserDefinedType: CompeteManager
// BaseClass      :   ArSchedulerObject, offset = 0x0
// VTable         :     , Type:  *
// Enum           :     AR_OBJECT_PRIORITY, Type: int
// Function       :     public void ArSchedulerObject(const struct ArSchedulerObject &)
// Function       :     public void ArSchedulerObject::ArSchedulerObject()
// Function       :     public unsigned int ArSchedulerObject::GetHandle()
// Function       :     public void ArSchedulerObject::onProcess(int)
// Function       :     public bool IsEnable()
// Function       :     public void Disable()
// Function       :     public bool IsDeleteRequested()
// Function       :     public volatile enum ArSchedulerObject::AR_OBJECT_PRIORITY GetPriority()
// Function       :     public volatile unsigned int GetPriorityQueueIndex()
// Function       :     public volatile int GetPendingPriority()
// Function       :     public volatile int GetFinalPriority()
// Function       :     public void EnterSpinLock()
// Function       :     public void LeaveSpinLock()
// Function       :     public volatile __int64 GetLastProcTime()
// Function       :     public volatile unsigned int GetLastProcTick()
// Data           :     this+0x8, Member, Type: volatile bool, bIsDeleteRequested
// Data           :     this+0x10, Member, Type: volatile __int64, last_proc_time
// Data           :     this+0x18, Member, Type: volatile unsigned int, last_proc_tick
// Data           :     this+0x1C, Member, Type: volatile enum ArSchedulerObject::AR_OBJECT_PRIORITY, pending_priority
// Data           :     this+0x20, Member, Type: volatile int, pending_thread_index
// Data           :     this+0x24, Member, Type: volatile unsigned int, pending_priority_queue_index
// Data           :     this+0x28, Member, Type: volatile enum ArSchedulerObject::AR_OBJECT_PRIORITY, priority
// Data           :     this+0x2C, Member, Type: volatile int, thread_index
// Data           :     this+0x30, Member, Type: volatile unsigned int, priority_queue_index
// Data           :     this+0x34, Member, Type: volatile int, lock
// Function       :     protected bool ArSchedulerObject::ProcDelete()
// Function       :     protected bool ArSchedulerObject::IsDeleteable()
// Function       :     protected void ArSchedulerObject::~ArSchedulerObject()
// Data           :     this+0x38, Member, Type: volatile bool, m_bIsEnable
// Function       :     public struct ArSchedulerObject & operator=(const struct ArSchedulerObject &)
// Function       :     public void __local_vftable_ctor_closure()
// Function       :     protected void * __vecDelDtor(unsigned int)
// 
// Function       :   public void CompeteManager(const struct CompeteManager &)
// Function       :   protected void CompeteManager::CompeteManager()
// Function       :   public static struct CompeteManager & CompeteManager::Instance()
// Function       :   public void CompeteManager::~CompeteManager()
// Function       :   public void CompeteManager::Init()
// Function       :   public void CompeteManager::DeInit()
// Function       :   public const unsigned short CompeteManager::RequestCompeteToPlayer(struct StructPlayer *, struct StructPlayer *)
// Function       :   public const unsigned short CompeteManager::AnswerRequestFromPlayer(struct StructPlayer *, const enum _COMPETE_ANSWER_TYPE &)

        public ushort RetireCompeteWithPlayer(Player retirer, CompeteEndType endType)
        {
            return 0;

        }
// Typedef        :   , Type: struct StructPlayer *
// Function       :   public const bool CompeteManager::IsStarted(const unsigned int, const bool)
// Function       :   public void CompeteManager::onProcess(int)
// Function       :   protected const unsigned int CompeteManager::insertCompeteInfo(const enum _COMPETE_TYPE &, const void *, const void *, const enum _COMPETE_STATE &, const __int64 &)
// Function       :   protected const bool CompeteManager::deleteCompeteInfo(const unsigned int)
// Function       :   protected struct CompeteInfoBase * CompeteManager::getCompeteInfo(const unsigned int)
// Function       :   protected const char * getCompetitorName(const struct CompeteInfoBase *, const bool)
// Function       :   protected const bool validateCompeteInfo(struct CompeteInfoBase *)
// Data           :   this+0x40, Member, Type: class XCriticalSection, m_csCompete
// UserDefinedType:     XCriticalSection
// 
// Data           :   this+0x80, Member, Type: class std::vector<CompeteInfoBase *,std::allocator<CompeteInfoBase *> >, m_vCompeteInfo
// UserDefinedType:     std::vector<CompeteInfoBase *,std::allocator<CompeteInfoBase *> >
// 
// Function       :   public struct CompeteManager & operator=(const struct CompeteManager &)
// Function       :   public void __local_vftable_ctor_closure()
// Function       :   public void * __vecDelDtor(unsigned int)

    }
}
